<template>
  <div id="app">
    <intro v-if="!logged&&!submitted"/>
    <home v-if="logged&&!submitted"/>
    <ending v-if="logged&&submitted"/>
  </div>
</template>

<script>
import Home from "@/components/Home.vue";
import Intro from "@/components/Intro.vue";
import Ending from "@/components/Ending.vue";
export default {
  name: "app",
  components: {
    Home,
    Intro,
    Ending
  },
  computed: {
    logged() {
      return this.$store.state.userName.length > 0;
    },
    submitted() {
      return this.$store.state.submitted;
    }
  },
  mounted() {
    this.$store.dispatch("initContent");
  }
};
</script>

<style>
body {
  background: #fff;
}
</style>
